+Tue Sep 18 13:51:35 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkcellrenderer.h (enum): Get rid of broken "can_edit" and
+ "can_activate" properties in favor of
+ GTK_CELL_RENDERER_MODE_INERT, GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ and GTK_CELL_RENDERER_MODE_EDITABLE
+
Tue Sep 18 12:12:43 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_put): Add put for use with
+Tue Sep 18 13:51:35 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkcellrenderer.h (enum): Get rid of broken "can_edit" and
+ "can_activate" properties in favor of
+ GTK_CELL_RENDERER_MODE_INERT, GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ and GTK_CELL_RENDERER_MODE_EDITABLE
+
Tue Sep 18 12:12:43 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_put): Add put for use with
+Tue Sep 18 13:51:35 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkcellrenderer.h (enum): Get rid of broken "can_edit" and
+ "can_activate" properties in favor of
+ GTK_CELL_RENDERER_MODE_INERT, GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ and GTK_CELL_RENDERER_MODE_EDITABLE
+
Tue Sep 18 12:12:43 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_put): Add put for use with
+Tue Sep 18 13:51:35 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkcellrenderer.h (enum): Get rid of broken "can_edit" and
+ "can_activate" properties in favor of
+ GTK_CELL_RENDERER_MODE_INERT, GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ and GTK_CELL_RENDERER_MODE_EDITABLE
+
Tue Sep 18 12:12:43 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_put): Add put for use with
+Tue Sep 18 13:51:35 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkcellrenderer.h (enum): Get rid of broken "can_edit" and
+ "can_activate" properties in favor of
+ GTK_CELL_RENDERER_MODE_INERT, GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ and GTK_CELL_RENDERER_MODE_EDITABLE
+
Tue Sep 18 12:12:43 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_put): Add put for use with
+Tue Sep 18 13:51:35 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkcellrenderer.h (enum): Get rid of broken "can_edit" and
+ "can_activate" properties in favor of
+ GTK_CELL_RENDERER_MODE_INERT, GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ and GTK_CELL_RENDERER_MODE_EDITABLE
+
Tue Sep 18 12:12:43 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_put): Add put for use with
+Tue Sep 18 13:51:35 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkcellrenderer.h (enum): Get rid of broken "can_edit" and
+ "can_activate" properties in favor of
+ GTK_CELL_RENDERER_MODE_INERT, GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ and GTK_CELL_RENDERER_MODE_EDITABLE
+
Tue Sep 18 12:12:43 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_put): Add put for use with
enum {
PROP_ZERO,
- PROP_CAN_ACTIVATE,
- PROP_CAN_EDIT,
+ PROP_MODE,
PROP_VISIBLE,
PROP_XALIGN,
PROP_YALIGN,
static void
gtk_cell_renderer_init (GtkCellRenderer *cell)
{
- cell->can_activate = FALSE;
- cell->can_edit = FALSE;
+ cell->mode = GTK_CELL_RENDERER_MODE_INERT;
cell->visible = TRUE;
cell->width = -1;
cell->height = -1;
class->get_size = NULL;
g_object_class_install_property (object_class,
- PROP_CAN_ACTIVATE,
- g_param_spec_boolean ("can_activate",
- _("can_activate"),
- _("Cell can get activate events."),
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_WRITABLE));
+ PROP_MODE,
+ g_param_spec_enum ("mode",
+ _("mode"),
+ _("Editable mode of the CellRenderer"),
+ GTK_TYPE_CELL_RENDERER_MODE,
+ GTK_CELL_RENDERER_MODE_INERT,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
- g_object_class_install_property (object_class,
- PROP_CAN_EDIT,
- g_param_spec_boolean ("can_edit",
- _("can_edit"),
- _("Cell supports CellEditable interface."),
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_WRITABLE));
-
g_object_class_install_property (object_class,
PROP_VISIBLE,
g_param_spec_boolean ("visible",
switch (param_id)
{
- case PROP_CAN_ACTIVATE:
- g_value_set_boolean (value, cell->can_activate);
- break;
- case PROP_CAN_EDIT:
- g_value_set_boolean (value, cell->can_edit);
+ case PROP_MODE:
+ g_value_set_enum (value, cell->mode);
break;
case PROP_VISIBLE:
g_value_set_boolean (value, cell->visible);
switch (param_id)
{
- case PROP_CAN_ACTIVATE:
- cell->can_activate = g_value_get_boolean (value);
- g_object_notify (object, "can_activate");
- /* can_activate and can_edit are mutually exclusive */
- if (cell->can_activate && cell->can_edit)
- {
- cell->can_edit = FALSE;
- g_object_notify (object, "can_edit");
- }
- break;
- case PROP_CAN_EDIT:
- cell->can_edit = g_value_get_boolean (value);
- g_object_notify (object, "can_edit");
- /* can_activate and can_edit are mutually exclusive */
- if (cell->can_activate && cell->can_edit)
- {
- cell->can_activate = FALSE;
- g_object_notify (object, "can_activate");
- }
+ case PROP_MODE:
+ cell->mode = g_value_get_enum (value);
+ g_object_notify (object, "mode");
break;
case PROP_VISIBLE:
cell->visible = g_value_get_boolean (value);
{
g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell), FALSE);
- if (! cell->can_activate)
+ if (cell->mode != GTK_CELL_RENDERER_MODE_ACTIVATABLE)
return FALSE;
if (GTK_CELL_RENDERER_GET_CLASS (cell)->activate == NULL)
{
g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell), NULL);
- if (! cell->can_edit)
+ if (cell->mode != GTK_CELL_RENDERER_MODE_EDITABLE)
return NULL;
if (GTK_CELL_RENDERER_GET_CLASS (cell)->start_editing == NULL)
GTK_CELL_RENDERER_SORTED = 1 << 3
} GtkCellRendererState;
+typedef enum
+{
+ GTK_CELL_RENDERER_MODE_INERT,
+ GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ GTK_CELL_RENDERER_MODE_EDITABLE,
+} GtkCellRendererMode;
+
#define GTK_TYPE_CELL_RENDERER (gtk_cell_renderer_get_type ())
#define GTK_CELL_RENDERER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CELL_RENDERER, GtkCellRenderer))
#define GTK_CELL_RENDERER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER, GtkCellRendererClass))
guint16 xpad;
guint16 ypad;
- guint can_activate : 1;
- guint can_edit : 1;
+ guint mode : 2;
guint visible : 1;
guint is_expander : 1;
guint is_expanded : 1;
{
celltoggle->active = FALSE;
celltoggle->radio = FALSE;
- GTK_CELL_RENDERER (celltoggle)->can_activate = TRUE;
+ GTK_CELL_RENDERER (celltoggle)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
GTK_CELL_RENDERER (celltoggle)->xpad = 2;
GTK_CELL_RENDERER (celltoggle)->ypad = 2;
}
state = GTK_STATE_ACTIVE;
}
}
- else if (! cell->can_activate)
+ else if (cell->mode == GTK_CELL_RENDERER_MODE_INERT)
{
state = GTK_STATE_INSENSITIVE;
}
GdkRectangle *cell_area,
guint flags)
{
- gboolean visible, can_activate, can_edit;
+ gboolean visible, mode;
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
g_object_get (G_OBJECT (((GtkTreeViewColumnCellInfo *) tree_column->cell_list->data)->cell),
"visible", &visible,
- "can_activate", &can_activate,
- "can_edit", &can_edit,
+ "mode", &mode,
NULL);
- if (visible && can_activate)
+ if (visible && mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)
{
if (gtk_cell_renderer_activate (((GtkTreeViewColumnCellInfo *) tree_column->cell_list->data)->cell,
event,
flags))
return TRUE;
}
- else if (visible && can_edit)
+ else if (visible && mode == GTK_CELL_RENDERER_MODE_EDITABLE)
{
*editable_widget = gtk_cell_renderer_start_editing (((GtkTreeViewColumnCellInfo *) tree_column->cell_list->data)->cell,
event,